*************************************************************************
*																		*
*					Campaign Panel Book Master Do-File					*
*																		*
*************************************************************************	

/*
This do-file contains the entire syntax for the Campaign Panel Book. In order to replicate the results please adjust
the working directory and create a folder structure organized as follows:

Reproducible Do-Files
	Chapter 1
	Chapter 2
		Figures
		Tables
		TablesII
	Chapter 3
	Chapter 4
		Figure
	Chapter 5
		Data
	Chapter 6
		Data
		Figures
	Data
	Data manipulation
	Master

Please place the following datasets into the folder "Reproducible Do-Files\Data":
ZA5305_en_v5-0-0, ZA5704_en_v3-2-0, ZA5757_v1-1-0, ZA5705_v1-0-0, scalometer government 2009, STP2009, CS2009, STP2013 und CS2013.

The entire replication of the empirical analysis for the book takes about 4 - 4.5 hours. Executing the replication 
is done	at one's own responsibility.

Finally, please set a global master path and a global data path.
*/

global path "L:\WKP-Buch"
global data "L:\WKP-Buch\Reproducible Do-Files\Data"

cd "${path}\Reproducible Do-Files\"

clear mata
clear matrix
set maxvar 32767
set more off
set scrollbufsize 2000000

*In order to properly run the Do-File please install the following ados
/*
ssc install fre
ssc install fsum
ssc install pr0046
ssc install estout
net from http://www.stata.com
net cd users
net cd vwiggins
net install grc1leg
*/

*Create overview Table 1
do "Chapter 1/Table 1.do"

*Create Timeline
do "${path}\Reproducible Do-Files\Chapter 1/Figure 1.do"


*Match the two separate datasets of the short-term panels 2009 and 2013
do "${path}\Reproducible Do-Files\Master/merge data 2009 2013.do"


*Run general data manipulation 
do "${path}\Reproducible Do-Files\Data manipulation/general data manipulation.do"


*Run the code for chapter 2
do "${path}\Reproducible Do-Files\Chapter 2\master_chapter 2.do"


*Run the code for chapter 3
do "${path}\Reproducible Do-Files\Chapter 3\master_chapter 3.do"


*Run the code for chapter 4
do "${path}\Reproducible Do-Files\Chapter 4\master_chapter 4.do"


*Run the code for chapter 5
do "${path}\Reproducible Do-Files\Chapter 5\master_chapter 5.do"


*Run the code for chapter 6
do "${path}\Reproducible Do-Files\Chapter 6\master_chapter 6.do"

